String clazzTpl({package}) => """
import 'package:flutter/material.dart';
import 'package:$package/utils/print_util.dart';

mixin BaseBindingObserver<T extends StatefulWidget>
    on State<T>, WidgetsBindingObserver {
  void postFrameCallback(Duration duration) {}

  @mustCallSuper
  @override
  void initState() {
    WidgetsBinding.instance.addObserver(this);
    WidgetsBinding.instance.addPostFrameCallback(postFrameCallback);
    super.initState();
  }

  @mustCallSuper
  @override
  void didChangeAppLifecycleState(AppLifecycleState state) {
    logDebugPrint('\${runtimeType.toString()} \$state');
    super.didChangeAppLifecycleState(state);
  }

  @mustCallSuper
  @override
  void dispose() {
    WidgetsBinding.instance.removeObserver(this);
    super.dispose();
  }
}
""";
